package com.sm.tool.entity.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @program: practice
 * @description:
 * @author: liqitian.
 * @create: 2019-11-15 15:39
 **/
@Data
@ApiModel
public class UserLoginRequest {
    @NotNull
    @Length(min = 8, max = 8, message = "用户名长度 8位")
    @Pattern(regexp="^\\w+$",message = "用户名格式错误，只能为英文加数字")
    @ApiModelProperty(value = "用户名(必须8位数)",example ="qa123456" ,required = true)
    private String userName;

    @NotNull
    @Pattern(regexp="^\\w+$",message = "用户密码格式错误，只能为英文或者数字")
    @Length(min = 5, max = 15, message = "用户密码长度 5-15")
    @ApiModelProperty(value = "密码(必须5-15位)",example ="Ly12345",required = true )
    private String passWord;

}
